<template>
  <div class="container" >
    <!-- 券转让组件 -->
    <div v-for="(item ,index) in list" :key="index">
      <div class="ticket" v-if="item.status == 0" @click="toDetail(item)">
        <div class="left">
          <div class="title">
            <span class="red">[{{item.ticket_type_name}}]</span>
            {{item.name}}
          </div>
          <div class="desc" v-if="item.describe">{{item.describe}}</div>
          <div class="num">{{item.validity_start_time}}-{{item.validity_end_time}}</div>
          <span v-if="item.ticket_type !==1&&item.is_use!==1">
            <span class="used">使用</span>
            <img
              src="https://mmkapp.oss-cn-beijing.aliyuncs.com/h5_images/mp_images/3.3/sanjiao.png"
              alt
              class="img"
            />
          </span>
        </div>
        <div class="right">
          <div class="transferbtn" @click="toorder" v-if="item.allow_transfer==1">
            <a href="/pages/material_center/transfer_order/main" @click.stop="toOrder(1,item)">转让</a>
            <!-- 转让 -->
          </div>
          <div class="sellbtn" v-if="item.allow_hangon==1" @click.stop="toOrder(2,item)">挂售</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import common from "@/assets/js/mmk_common.js";
export default {
  data() {
    return {
      ImgBaseUrl: common.image_response //img 域名
    };
  },
  props: {
    list: ""
  },
  methods: {
    toOrder(e, item) {
      //跳转到卡下单
      wx.navigateTo({
        url:
          "/pages/ct_store/transfer_sale/main?orderType=" +
          e +
          "&type=2" +
          "&id=" +
          item.id
      });
    },
    toDetail(item) {
      wx.navigateTo({
        url:
          "/pages/ct_store/ct_detail_flea/main?type=2&source=2&opt=2&id=" +
          +item.id
      });
    }
  },
  watch: {},

  onLoad() {},
  destroyed() {}
};
</script>


<style lang="less" scoped>
.container {
  // background: #fff;
  height: auto;
  padding: 10px 12px 0px;
  background: #f3f4f6;
  .ticket {
    height: 121px;
    display: flex;
    margin-bottom: 13px;
    .left {
      width: 82.9%;
      box-sizing: border-box;
      padding: 14px 14px 10px 14px;
      border-radius: 8px;
      background: #fff;
      position: relative;
      .title {
        height: auto;
        font-size: 14px;
        font-weight: 500;
        color: rgba(51, 51, 51, 1);
        margin-bottom: 10px;
        // margin-bottom: 35px;
        // overflow: hidden;
        // text-overflow: ellipsis;
        // display: -webkit-box;
        // -webkit-line-clamp: 2;
        // -webkit-box-orient: vertical;
        .red {
          color: rgba(255, 56, 62, 1);
        }
      }
      .desc {
        width: 80%;
        // height:40px;
        line-height: 20px;
        font-size: 12px;
        color: rgba(153, 153, 153, 1);
        margin-bottom: 32px;
        //    overflow: hidden;
        // text-overflow: ellipsis;
        // display: -webkit-box;
        // -webkit-line-clamp: 2;
        // -webkit-box-orient: vertical;
      }
      .num {
        font-size: 12px;
        color: #666666;
        position: absolute;
        bottom: 14px;
        left: 14px;
      }
      .used {
        font-size: 12px;
        color: rgba(255, 95, 75, 1);
        position: absolute;
        bottom: 14px;
        right: 26px;
      }
      .img {
        width: 3px;
        height: 12px;
        position: absolute;
        bottom: 16px;
        right: 20px;
      }
    }
    .right {
      width: 60px;
      height: 121px;
      border-radius: 8px;
      background: url("https://mmkapp.oss-cn-beijing.aliyuncs.com/h5_images/mp_images/3.3/pink_bg_right.png")
        no-repeat;
      background-size: 100% 100%;
      color: rgba(255, 56, 62, 1);
      font-size: 12px;
      position: relative;
      box-sizing: border-box;
      padding-left: 10px;
      .transferbtn {
        width: 40px;
        height: 26px;
        background: rgba(255, 255, 255, 0.7);
        border-radius: 6px;
        color: rgba(94, 46, 28, 1);
        line-height: 26px;
        text-align: center;
        margin-top: 15px;
        // margin-bottom: 40px;
      }
      .sellbtn {
        width: 40px;
        height: 26px;
        border-radius: 6px;
        border: 1px solid rgba(255, 255, 255, 1);
        color: #fff;
        line-height: 26px;
        text-align: center;
        position: absolute;
        bottom: 15px;
        left: 10px;

      }
    }
  }
}
</style>


